//
//  kefuVC.m
//  BeautyPicture
//
//  Created by 沈振邦 on 15/12/16.
//  Copyright © 2015年 szb. All rights reserved.
//

#import "kefuVC.h"

#define telephone  @"0771-5789462"

@interface kefuVC ()



@end

@implementation kefuVC

- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBarHidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated{
    self.navigationController.navigationBarHidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self createErWM];
    
    // Do any additional setup after loading the view.
}


- (void)createErWM{
    
    
    CGFloat backX = 15.0f;
    CGFloat backY = 22.0f;
    CGFloat backW = 30.0f;
    CGFloat backH = 30.0f;
    // 返回按钮
    UIButton *back = [[UIButton alloc] initWithFrame:CGRectMake(backX, backY, backW, backH)];
    [back setImage:[UIImage imageNamed:@"返回"] forState:UIControlStateNormal];
    [back addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:back];
    
    // 二维码
    UIImageView *ErWm = [[UIImageView alloc] initWithFrame:CGRectMake(150 / 2, 150 / 2, self.view.frame.size.width - 150, self.view.frame.size.width - 150)];
    ErWm.image = [UIImage imageNamed:@"ErWei"];
    [self.view addSubview:ErWm];
    
    // "扫一扫" 的 提示 label
    UILabel *labelTiShi = [[UILabel alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 80, self.view.frame.size.height - 300, 160, 30)];
    labelTiShi.text = @"扫一扫关注微信";
    labelTiShi.textAlignment = 1;
    labelTiShi.textColor = [UIColor grayColor];
    labelTiShi.font = [UIFont systemFontOfSize:15];
    [self.view addSubview:labelTiShi];
    
    
    // 电话 号码 (图片)
    UIImageView *imageNumber = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 100, self.view.frame.size.height - 200, 200, 30)];
    imageNumber.image = [UIImage imageNamed:@"ReXian"];
    [self.view addSubview:imageNumber];
    
    // 一键拨号
    UIButton *call = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 75, self.view.frame.size.height - 160, 160, 40)];
    [call setImage:[UIImage imageNamed:@"call"] forState:UIControlStateNormal];
    [call addTarget:self action:@selector(call:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:call];
    
    
    // 公司名称
    UILabel *labeC = [[UILabel alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 150, self.view.frame.size.height - 100, 300, 30)];
    labeC.text = @"广西云印网络科技有限公司";
    labeC.textAlignment = 1;
    labeC.textColor = [UIColor grayColor];
    [self.view addSubview:labeC];
    
    // 地址
    UILabel *address = [[UILabel alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 150, self.view.frame.size.height - 70, 300, 40)];
    address.text = @"地址:广西南宁市青秀区中柬路9号利海亚洲国际2栋1829-1831   QQ:3065370894";
    address.numberOfLines = 0;
    address.font = [UIFont systemFontOfSize:13];
    address.textColor = [UIColor grayColor];
    [self.view addSubview:address];
}

- (void)call:(UIButton *)bu{
    NSString *phone = [NSString stringWithFormat:@"tel://%@", telephone];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phone]];
}

- (void)back:(UIButton *)butt{
    [self.navigationController popViewControllerAnimated:YES];
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
